/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package at.ac.big.tuwien.ewa.twitter;

import org.apache.log4j.Logger;
import twitter4j.Status;
import twitter4j.TwitterException;
import twitter4j.TwitterFactory;

/**
 *
 * @author robert
 */
public class Twitter implements TwitterConnector{
    private final static Logger LOG = Logger.getLogger(Twitter.class.getName());
    public Twitter(){

    }

    @Override
    public Status postMessage(Score score) throws TwitterException {
        
        
        twitter4j.Twitter twitter = new TwitterFactory().getInstance();
        Status status = twitter.updateStatus(score.getTwitterPublicationString());
        LOG.debug("Folgender Status getweeted: "+score.getTwitterPublicationString());
        
        return status;
    }
    
}
